package com.longrou.base.util.http;

import android.util.Log;

import com.longrou.base.base.BaseResult;
import com.zhouyou.http.callback.CallBack;
import com.zhouyou.http.callback.CallBackProxy;
import com.zhouyou.http.callback.CallClazzProxy;
import com.zhouyou.http.request.GetRequest;

import java.lang.reflect.Type;

import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;

/**
 * @Description:
 * @Author: LongRou
 * @CreateDate: 2018-05-25 15:22
 * @Version: 1.0
 **/
public class CustomGetRequest extends GetRequest {
    public CustomGetRequest(String url) {
        super(url);
    }

    /**
     * 覆写execute方法指定
     *
     * @param type
     * @param <T>
     * @return
     */
    @Override
    public <T> Observable<T> execute(Type type) {
        return super.execute(new CallClazzProxy<BaseResult<T>, T>(type) {
        });
    }

    @Override
    public <T> Observable<T> execute(Class<T> clazz) {
        return super.execute(new CallClazzProxy<BaseResult<T>, T>(clazz) {
        });
    }

    @Override
    public <T> Disposable execute(CallBack<T> callBack) {
        Log.e("eeee","sdfsdfsdfsd");
        return super.execute(new CallBackProxy<BaseResult<T>, T>(callBack) {
        });
    }
}